SPB Git

Repository Public

page.tsx 4.9 KB 130 lines tsx

1/**2 * =============================================================================3 *                  SP BOUCHER | ACADEMIC RESEARCH4 *             ARTIFICIAL INTELLIGENCE • FINANCE • ENGINEERING5 * =============================================================================6 *7 * PROJECT METADATA8 * -----------------------------------------------------------------------------9 * Project          : UQO Éval10 * File             : src/app/a-vendre/[uid]/evaluer/page.tsx11 * Module           : app12 * Repository       : https://git.spboucher.ai/uqo-eval13 * Project Website  : https://www.uqo-eval.app14 * Created          : 2026-10-0215 * Last Modified    : 2026-10-0216 *17 * =============================================================================18 * SOFTWARE MAINTAINER & AFFILIATION19 * =============================================================================20 *21 * Maintainer       : Simon-Pierre Boucher22 * Position         : Professor of Finance23 * Institution      : Université du Québec en Outaouais (UQO)24 * Department       : Département des sciences administratives25 * Website          : https://spboucher.ai26 * Git              : https://git.spboucher.ai27 *28 * Research Contact : research@spboucher.ai29 * Direct Contact   : simon@spboucher.ai30 * Security/Admin   : admin@spboucher.ai31 *32 * The affiliation is descriptive. It is not an institutional endorsement,33 * a license grant or a determination of ownership.34 *35 * =============================================================================36 * COPYRIGHT, AUTHORSHIP & DATA37 * =============================================================================38 *39 * Copyright (c) the author(s) of this work.40 * Ownership is not asserted by this notice; see the repository records.41 *42 * This header identifies the maintainer of the software. Scientific43 * authorship of any associated paper is stated in the paper itself and44 * is not changed by this notice. Datasets and third-party materials45 * remain the property of their respective owners and licensors.46 *47 * This file is governed by the applicable project license, copyright48 * notices, institutional agreements and relevant law.49 *50 * =============================================================================51 * LICENSE & MAINTENANCE52 * =============================================================================53 *54 * License          : None specified (no license file in this repository)55 * Classification   : Public56 *57 * =============================================================================58 * END OF SP BOUCHER SOURCE HEADER59 * =============================================================================60 */6162// UQO Éval — laboratoire pédagogique d'évaluation immobilière63// Atelier « mon évaluation » : l'étudiant choisit ses comparables, les ajuste,64// réconcilie sa valeur et la compare à la mesure UQO Éval et au prix demandé.65import type { Metadata } from "next";66import { notFound } from "next/navigation";67import { getListing } from "@/lib/immoka";68import EvalWorkbench, { type WorkbenchHead } from "@/components/avendre/EvalWorkbench";69import { moneyFr } from "@/lib/seo";7071export const dynamic = "force-dynamic";7273function head(uid: string): WorkbenchHead | null {74  const det = getListing(uid);75  if (!det) return null;76  const l = det.listing;77  const e = det.eval;78  return {79    uid: l.uid,80    address: l.address,81    city: l.city,82    propertyType: l.property_type,83    group: det.group,84    price: l.price,85    image: det.images[0] ?? null,86    bedrooms: l.bedrooms,87    bathrooms: l.bathrooms,88    areaSqft: l.area_sqft,89    lotSqft: l.lot_sqft,90    yearBuilt: l.year_built,91    geolocated: l.lat != null && l.lng != null,92    eval: e93      ? {94          est: e.est,95          low: e.low,96          high: e.high,97          confidence: e.confidence,98          modelEst: e.model_est,99          compsEst: e.comps_est,100          costEst: e.cost_est,101          roleEst: e.role_est,102          ensEst: e.ens_est,103          valeurRole: e.valeur_role,104          nComps: e.n_comps,105          unitId: e.unit_id,106          evaluatedAt: e.evaluated_at,107        }108      : null,109  };110}111112export async function generateMetadata({ params }: { params: Promise<{ uid: string }> }): Promise<Metadata> {113  const { uid } = await params;114  const h = head(decodeURIComponent(uid));115  if (!h) return { title: "Propriété introuvable" };116  const where = [h.address, h.city].filter(Boolean).join(", ");117  return {118    title: `Mon évaluation — ${where} (${moneyFr(h.price)})`,119    description: "Atelier : choisir ses comparables, les ajuster en dollars, réconcilier une valeur et la comparer à la mesure UQO Éval.",120    robots: { index: false, follow: false },121  };122}123124export default async function EvaluerPage({ params }: { params: Promise<{ uid: string }> }) {125  const { uid } = await params;126  const h = head(decodeURIComponent(uid));127  if (!h) notFound();128  return <EvalWorkbench head={h} />;129}130
Files main
Menu

Theme